import sys
from PySide6.QtWidgets import *
from PySide6.QtGui import Qt


class gridLayOut(QWidget):

    def __init__(self, parent=None):
        super().__init__()
        self.grid = QGridLayout()
        self.setLayout(self.grid)

    def addItems(self, items=[], row=0, columnspan=1, alignment=Qt.AlignHCenter | Qt.AlignVCenter):

        for i in range(len(items)):
            itemLabel = QLabel(str(i))
            self.grid.addWidget(itemLabel, row+i, columnspan)


if __name__ == "__main__":
    app = QApplication([])
    widget = gridLayOut()
    widget.addItems(["A", "B", "C", "D"])
    widget.show()
    sys.exit(app.exec_())
